Code example: ShowWorkflowButtons property

The ASP file that contains the below code can be referred to as:

  • The custom file name in the List to jump to. In this case it shows the edit screen for one record in the table and the workflow buttons for the current record.
  • The custom file name in the Primary rule. In this case the page creates a new record in the workflow.

<!-- #include file ="sagecrm.js" -->;
<%
Response.Write(CRM.GetTabs());
ThisId = Request.QueryString("Tab_TableId");
TableDetailBox = CRM.GetBlock("MyTableEntryBox");
Holder = CRM.GetBlock('container');
Holder.AddBlock(TableDetailBox);
with (TableDetailBox)
{
// Display the Delete button.
DisplayButton(Button_Delete) = true;

// Display the Continue button. This button takes the user back to the list.
DisplayButton(Button_Continue) = true;
Title = "My Table Details";
}

// If no ID was passed, then switch to the New mode.
if (!Defined(ThisId))
{
MyRecord = CRM.CreateRecord("MyTable");
if (CRM.Mode <= Edit)
CRM.Mode = Edit;
}
else
{
MyRecord = CRM.FindRecord("MyTable","Tab_TableId = "+ThisId);
}
Holder.ShowWorkflowButtons = true;
Holder.WorkflowTable = 'MyTable';
CRM.AddContent(Holder.Execute(MyRecord));
Response.Write(CRM.GetPage());
%>